import 'package:shared_preferences/shared_preferences.dart';

Future<String> getStorage({required String key, String initData = ""}) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  String? s = prefs.getString(key);
  if (s == null) {
    await prefs.setString(key, initData);
    //   printBlue('''{
    //   method:取
    //   key: $key
    // }''');
    return initData;
  } else {
    return s;
  }
}

setStorage({required String key, required String value}) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  String? _ = prefs.getString(key);
  // printBlue('''{
  //   method:存
  //   key: $key,
  //   value: $value
  // }''');
  return await prefs.setString(key, value);
}
